Skip to content

fix(jupiter): support sqlite migration#1030

Merged
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main
May 15, 2025
Merged

fix(jupiter): support sqlite migration#1030
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented May 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 10:50am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for SQLite migration while refactoring the database connection and tree retrieval logic across several modules.

  • Added the Hash trait derivation for tree item types to facilitate hash-based collections.
  • Modified storage methods to accept tree hash vectors by reference and updated database migration logic, including conditional enum creation.
  • Updated Git API service and pack handlers to utilize a caching mechanism for tree retrieval.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mercury/src/internal/object/tree.rs Added Hash derivation for TreeItemMode and TreeItem.
jupiter/src/storage/mono_storage.rs Changed get_trees_by_hashes parameter to a reference type.
jupiter/src/storage/init.rs Refactored connection creation and migration triggering for both PostgreSQL and SQLite.
jupiter/src/storage/git_db_storage.rs Updated parameter passing to match mono_storage.
jupiter/migration/src/m20250314_025943_init.rs Adjusted migration to conditionally create enum types only for PostgreSQL.
ceres/src/pack/monorepo.rs Updated tree retrieval calls to use reference parameters and caching.
ceres/src/pack/import_repo.rs Updated tree retrieval and commit traversal to use caching and reference parameters.
ceres/src/model/git.rs Modified conversion of tree items to include commit information.
ceres/src/api_service/mono_api_service.rs Updated API service functions to incorporate caching and reference parameters.
ceres/src/api_service/mod.rs Introduced GitObjectCache and updated trait signatures for caching support.
ceres/src/api_service/import_api_service.rs Updated API service methods to pass references and utilize caching for tree lookups.
Comments suppressed due to low confidence (1)

jupiter/migration/src/m20250314_025943_init.rs:48

  • The enum creation for MergeStatusEnum is duplicated for DatabaseBackend::Postgres; consider consolidating these calls to prevent potential conflicts or redundant operations.
manager.create_type(Type::create().as_enum(MergeStatusEnum).values(MergeStatus::iter()).to_owned(),).await?;

Comment thread ceres/src/pack/monorepo.rs Outdated
}

let want_tree_ids = want_commits.iter().map(|c| c.tree_id.to_string()).collect();
let want_tree_ids = &want_commits.iter().map(|c| c.tree_id.to_string()).collect();

Copilot AI May 15, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding a reference to the result of collect() may lead to lifetime issues; consider explicitly creating a vector variable to hold the collected values before referencing it.

Suggested change
let want_tree_ids = &want_commits.iter().map(|c| c.tree_id.to_string()).collect();
let want_tree_ids_vec: Vec<String> = want_commits.iter().map(|c| c.tree_id.to_string()).collect();
let want_tree_ids = &want_tree_ids_vec;

Copilot uses AI. Check for mistakes.
@genedna
genedna added this pull request to the merge queue May 15, 2025
Merged via the queue into gitmono-dev:main with commit 7c82ef0 May 15, 2025
@benjamin-747 benjamin-747 linked an issue May 16, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Monobean] no such column: mega_refs.is_mr

3 participants